﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.IO;
using System.Windows.Forms;

namespace framework.map
{
    class MapParser
    {

        private string Path;

        // PARSING
        public MapParser(string path)
        {
            this.Path = path;
        }

        public string[] getEntities()
        {
            return new string[1];
        }

        public Entity EntityParser(string text)
        {
            Entity ent = new Entity();
            char[] del = { '"' };
            string[] temp = text.Split(del);

            ent.classname = temp[3];

            int count = 5, counter = 0;
            string[] names = new string[count];
            string[] values = new string[count];

            while (count < temp.Length)
            {
                names[counter] = temp[count];
                values[counter] = temp[count + 2];
                count += 4;
                counter++;
            }

            return ent;
        }

        // WRITING

        public static string line(string name, string value)
        {
            return "\"" + name + "\" \"" + value + "\"\n";
        }
    }
}
